package com.jinbo.footmessage.httpretrofit;
import com.jinbo.footmessage.httpbean.BaseBean;
import com.jinbo.footmessage.httpbean.CommentBean;
import com.jinbo.footmessage.httpbean.OrderBean;
import com.jinbo.footmessage.httpbean.OrdersBean;
import com.jinbo.footmessage.httpbean.UserInformationBean;
import com.jinbo.footmessage.httpbean.SendCodeBean;
import com.jinbo.footmessage.httpbean.WorkerInformationBean;
import com.jinbo.footmessage.httpbean.WorkersBean;

import retrofit.Callback;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.GET;
import retrofit.http.Multipart;
import retrofit.http.POST;
import retrofit.http.Part;
import retrofit.http.Query;
import retrofit.mime.TypedFile;


public interface HttpProtocol
{
    /**
     * 申请发送手机验证码
     *
     * @param mobile
     * @param callback
     */
    @GET("/Verify/SendCode")
    public void sendCode(@Query("mobile") String mobile,
                         Callback<BaseBean<SendCodeBean>> callback);



    /**
     * 注册
     *
     * @param mobile
     * @param password
     * @param name
     * @param sex
     * @param callback
     */
    @FormUrlEncoded
    @POST("/Account/Register")
    public void register(@Field("mobile") String mobile,
                         @Field("password") String password,
                         @Field("name") String name,
                         @Field("sex") String sex,
                         Callback<BaseBean<UserInformationBean>> callback);
    /**
     * 登录
     *
     * @param mobile
     * @param passWord
     * @param callback
     */
    @FormUrlEncoded
    @POST("/Account/Login")
    public void login(@Field("mobile") String mobile,
                      @Field("password") String passWord,
                      Callback<BaseBean<UserInformationBean>> callback);
    /**
     * 找回密码
     *
     * @param mobile
     * @param password
     * @param callback
     */
    @FormUrlEncoded
    @POST("/Account/ResetPassword")
    public void findPassword(@Field("mobile") String mobile,
                             @Field("password") String password,
                             Callback<BaseBean<UserInformationBean>> callback);



    /**
     * 修改头像
     * @param user_id
     * @param file
     * @param kind
     */
    @Multipart
    @POST("/User/Head")
    public void modifyFace(
            @Part("user_id") String user_id,
            @Part("file") TypedFile file,
            @Part("kind") int kind,
            Callback<BaseBean<UserInformationBean>> callback);
    /**
     * 修改用户名
     *
     * @param user_id
     * @param new_name
     * @param callback
     */
    @FormUrlEncoded
    @POST("/User/Name")
    public void modifyUserName(@Field("user_id") String user_id,
                               @Field("new_name") String new_name,
                               Callback<BaseBean<UserInformationBean>> callback);
    /**
     * 修改用户性别
     *
     * @param user_id
     * @param sex
     * @param callback
     */
    @FormUrlEncoded
    @POST("/User/Sex")
    public void modifyUserSex(@Field("user_id") String user_id,
                              @Field("sex") String sex,
                              Callback<BaseBean<UserInformationBean>> callback);

    /**
     * 修改用户邮箱
     *
     * @param user_id
     * @param mail
     * @param callback
     */
    @FormUrlEncoded
    @POST("/User/Mail")
    public void modifyUserEmail(@Field("user_id") String user_id,
                                @Field("mail") String mail,
                                Callback<BaseBean<UserInformationBean>> callback);

    /**
     * 修改密码
     *
     * @param user_id
     * @param old_password
     * @param new_password
     * @param callback
     */
    @FormUrlEncoded
    @POST("/User/UpdatePassword")
    public void modifyUserPassword(
            @Field("user_id") String user_id,
            @Field("old_password") String old_password,
            @Field("new_password") String new_password,
            Callback<BaseBean<UserInformationBean>> callback);

    /**
     * 查看所有技师
     *
     *
     * @param callback
     */
    @GET("/User/LookWorker")
    public void LookWorkers(Callback<BaseBean<WorkersBean>> callback);

    /**
     * 获取技师的项目
     *@param user_id
     *
     */
    @GET("/Worker/GetMyProjects")
    public void getMyProjects(@Query("user_id") String user_id,
                              Callback<BaseBean<WorkerInformationBean>> callback);
    /**
     * 获取技师的评论
     *@param worker_id
     *
     */
    @GET("/User/Comments")
    public void getComments(@Query("worker_id") String worker_id,
                            @Query("start") int start,
                            @Query("limit") int limit,
                              Callback<BaseBean<WorkerInformationBean>> callback);

    /**
     * 预约订单
     *
     *
     */
    @FormUrlEncoded
    @POST("/User/MakeOrder")
    public void MakeOrder(
            @Field("date") String date,
            @Field("week") String week,
            @Field("begin_time") String begin_time,
            @Field("end_time") String end_time,
            @Field("content") String content,
            @Field("total_price") String total_price,
            @Field("worker_id") String worker_id,
            @Field("user_id") String user_id,
            @Field("contact_name") String contact_name,
            @Field("contact_address") String contact_address,
            @Field("contact_phone") String contact_phone,
            @Field("contact_sex") String contact_sex,
            @Field("order_time") String order_time,
            Callback<BaseBean<OrderBean>> callback);

    /**
     * 查询待确认订单
     *@param user_id
     *
     */
    @GET("/User/NotComfirmOrder")
    public void NotConfirmOrder(@Query("user_id") String user_id,
                            Callback<BaseBean<OrdersBean>> callback);

    /**
   * 用户取消待确认的单
   *@param id
   *
   */
    @GET("/User/CancleNotComfirmOrder")
    public void CancelOrder(@Query("id")int id,
                            Callback<BaseBean<OrdersBean>> callback);

    /**
     * 查询确认订单
     *@param user_id
     *
     */
    @GET("/User/ComfirmOrder")
    public void confirmOrder(@Query("user_id") String user_id,
                             @Query("start") int start,
                             @Query("limit") int limit,
                                Callback<BaseBean<OrdersBean>> callback);

    /**
     * 评论订单
     *
     *
     */
    @FormUrlEncoded
    @POST("/User/CommentOrder")
    public void commentOrder(
            @Field("id") int  id,
            @Field("comment") String comment,
            @Field("star") double star,
            @Field("time") String time,
            Callback<BaseBean<CommentBean>> callback);



}
